#include "GraderManager.h"
#include "../Shared/GraderStatus.h"
using namespace std;

GraderManager::GraderManager()
{
    Init();
}

GraderManager::~GraderManager()
{
    //dtor
}

void GraderManager::Execute() {
}

void GraderManager::AssignRequest(int pGraderId , Request pRequest) {
}

int GraderManager::GetAvailableGraderId(int pPurpose) {
    #ifdef dummy
    return at(pPurpose + 1).ID;
    #endif
}

void GraderManager::Init() {
    //TODO: Log here
    #ifdef dummy
    std::cout << "GraderManager init" << std::endl;

    GraderStatus tStatus;
    tStatus.ID = 1;
    tStatus.Address = InternetAddress("127.0.0.1" , 10000);
    tStatus.PhysicalAddress = "";

    insert(make_pair(1 , tStatus));

    tStatus;
    tStatus.ID = 2;
    tStatus.Address = InternetAddress("127.0.0.1" , 20000);
    tStatus.PhysicalAddress = "";

    insert(make_pair(2 , tStatus));

    #endif
}
